package com.learn.dubbo.web.user;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.learn.dubbo.entity.user.SysUser;
import com.learn.dubbo.user.service.UserRemoteService;


@Controller
@RequestMapping("/user")
public class UserController {
	
	@SuppressWarnings("unused")
	private static final Logger logger = LoggerFactory.getLogger(UserController.class);
	
	@Reference
	private UserRemoteService userRemoteService;
	
	@RequestMapping("/")
	public String goIndex(){
		return "index";
	}
	
	@RequestMapping("/getUser")
	@ResponseBody
	public SysUser getSysUserInfo(){
		return userRemoteService.getUserInfo(1L);
	}

}
